STEP 5: What is each coin worth? We will randomly choose from values stored in the list coins_values!

  • In LOGIC, click and drop Random Choice indented inside the loop.
  • Change the variable name my_var to value.
  • Change the variable argument in .choice() from my_list to coin_values.

Random Choice chooses an item from a list at random. Here, it will choose a new value each time the loop runs.

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)